/**
 * 
 */
package de.nak.fireDepartment.service;

import java.util.Collection;

import de.nak.fireDepartment.exceptions.CarNotFoundException;
import de.nak.fireDepartment.exceptions.DepartmentAlreadyExistsException;
import de.nak.fireDepartment.exceptions.DepartmentNotFoundException;
import de.nak.fireDepartment.exceptions.ErrorOnDeleteException;
import de.nak.fireDepartment.model.Department;

/**
 * Interface for the department service.
 * @author Sven Redelin
 */
public interface DepartmentService {
	/**
	 * Creates a new department and stores it in the database
	 * @param city
	 * @param zipcode
	 * @param street
	 * @param houseNumber
	 * @param telephoneNumber
	 * @param telefaxNumber
	 * @param homepageURL
	 * @param eMail
	 * @param descriptionText
	 * @param chief
	 * @param coChief
	 * @param members
	 * @param imageURL
	 * @param carIds
	 * @throws DepartmentAlreadyExistsException
	 * @throws CarNotFoundException
	 */
	void createDepartment(String city,
						  String zipcode,
						  String street,
						  int houseNumber,
						  String telephoneNumber,
						  String telefaxNumber,
						  String homepageURL,
						  String eMail,
						  String descriptionText,
						  String chief,
						  String coChief,
						  int members,
						  String imageURL,
						  Long[] carIds) throws DepartmentAlreadyExistsException, CarNotFoundException;

	/**
	 * List all departments currently stored in the database.
	 *
	 * @return a list of Departments entities. If no department was found an empty list is
	 *         returned.
	 */
	Collection<Department> listDepartments();

	/**
	 * Returns the department identified by the given id.
	 *
	 * @param id The identifier.
	 * @return the found entity.
	 * @throws DepartmentNotFoundException
	 */
	Department showDepartment(Long id) throws DepartmentNotFoundException;

	/**
	 * Updates a department entity and stores the changes into the database
	 * @param id
	 * @param city
	 * @param zipcode
	 * @param street
	 * @param houseNumber
	 * @param telephoneNumber
	 * @param telefaxNumber
	 * @param homepageURL
	 * @param eMail
	 * @param descriptionText
	 * @param chief
	 * @param coChief
	 * @param members
	 * @param imageURL
	 * @param carIds
	 * @throws DepartmentNotFoundException
	 * @throws CarNotFoundException
	 * @throws DepartmentAlreadyExistsException 
	 */
	void updateDepartment(long id,
						  String city,
						  String zipcode,
						  String street,
						  int houseNumber,
						  String telephoneNumber,
						  String telefaxNumber,
						  String homepageURL,
						  String eMail,
						  String descriptionText,
						  String chief,
						  String coChief,
						  int members,
						  String imageURL,
						  Long[] carIds) throws DepartmentNotFoundException, CarNotFoundException, DepartmentAlreadyExistsException;

	/**
	 * Deletes the department with the given id.
	 *
	 * @param id The identifier.
	 * @throws DepartmentNotFoundException
	 * @throws ErrorOnDeleteException 
	 */
	void deleteDepartment(Long id) throws DepartmentNotFoundException, ErrorOnDeleteException;

}
